+ Changed protocol to 0.3 because we now accept both -foo and foo
as argument introducers. in 0.4-pre10, these were changed
from foo to -foo and this broke many clients. This change
should fix that and be backward/forward compatible.
+ Added a noop function to the protocol. This is useful for writing
shell script clients of LCDproc.
+ Changed the shared sock_send_string function to NOT send the
ending NUL ('\0') byte with the string. This was confusing
in Perl clients which saw NUL's as the first character of
each reply. WARNING: The LCDPROC client depended on this
behavior, your client may too. Use the newline instead.
See the code in clients/lcdproc/main.c (look for "switch(buf[i])")
to see one way to handle this. This should allow new clients
to connect to old servers and vice-versa.
+ Messed with include structure in .c files. It should no longer
be necessary to specify ../.. to get to shared code headers.
Also, since we are using automake, the global config.h can be
found with just #include "config.h" as it's location is included
in a -I to the compilers. As a result "make distcheck" now works.
This commit is contained in:
1 parent
211a3a4b04
commit
00cc9fca23
48 files changed
+222
-223
No files matched your search
+17
-19
@@ -230,25 +230,21 @@ main_loop (mode * sequence)
|
||||
argc = 0;
|
||||
newtoken = 1;
|
||||
for (i = 0; i < len; i++) {
|
||||
if (buf[i]) // For regular letters, keep tokenizing...
|
||||
{
|
||||
switch (buf[i]) {
|
||||
case ' ':
|
||||
newtoken = 1;
|
||||
buf[i] = 0;
|
||||
break;
|
||||
case '\n':
|
||||
buf[i] = 0;
|
||||
default:
|
||||
if (newtoken) {
|
||||
argv[argc] = buf + i;
|
||||
argc++;
|
||||
}
|
||||
newtoken = 0;
|
||||
break;
|
||||
switch (buf[i]) {
|
||||
case ' ':
|
||||
newtoken = 1;
|
||||
buf[i] = 0;
|
||||
break;
|
||||
default: // regular chars, keep tokenizing
|
||||
if (newtoken) {
|
||||
argv[argc] = buf + i;
|
||||
argc++;
|
||||
}
|
||||
} else // If we've got a zero, it's the end of a string...
|
||||
{
|
||||
newtoken = 0;
|
||||
break;
|
||||
case '\0':
|
||||
case '\n':
|
||||
buf[i] = 0;
|
||||
if (argc > 0) {
|
||||
//printf("%s %s\n", argv[0], argv[1]);
|
||||
if (0 == strcmp (argv[0], "listen")) {
|
||||
@@ -293,9 +289,11 @@ main_loop (mode * sequence)
|
||||
}
|
||||
}
|
||||
|
||||
// Restart tokenizing
|
||||
argc = 0;
|
||||
newtoken = 1;
|
||||
}
|
||||
break ;
|
||||
} // switch( buf[i] )
|
||||
}
|
||||
|
||||
len = sock_recv (sock, buf, 8000);
|
||||
|
||||
Reference in new issue
Block a user