Commit d9e22a9a54c273bdcf7df1df32b79bbd099ae737

Authored by Georg Hopp
1 parent c4de22c3

small fix

... ... @@ -16,5 +16,12 @@ coverage-html:
16 16 -$(MAKE) -C tests $(AM_MAKEFLAGS) -k $@
17 17 endif
18 18
  19 +REGEX_CCLASS=/^[ \t]*\(TR_CLASS\|TR_INTERFACE\)\(([a-zA-Z0-9_]+)/\2/d,definition/
19 20 tags:
20   - ctags -R -V --langdef=cclass --langmap=cclass:.h --regex-cclass='/^[ \t]*\(TR_CLASS\|TR_INTERFACE\)\(([a-zA-Z0-9_]+)/\2/d,definition/'
  21 + @ctags -R -V --langdef=cclass --langmap=cclass:.h \
  22 + --regex-cclass='$(REGEX_CCLASS)'
  23 +
  24 +loc:
  25 + @find src/ include/ -not -path testers -and -name "*.[ch]" \
  26 + -exec sed '/\/\*/,/\*\//d;/\/\//d' {} \; | wc -l
  27 +
... ...
... ... @@ -81,7 +81,11 @@ protocolRawParse(void * _this, TR_ProtoMessage _message, TR_RemoteData _data)
81 81 }
82 82
83 83 if (size >= message->size - message->size_done) {
84   - memcpy(message->data, data, message->size - message->size_done);
  84 + memcpy(
  85 + message->data + message->size_done,
  86 + data,
  87 + message->size - message->size_done);
  88 +
85 89 size -= message->size - message->size_done;
86 90 data += message->size - message->size_done;
87 91 message->size_done = message->size;
... ... @@ -91,8 +95,8 @@ protocolRawParse(void * _this, TR_ProtoMessage _message, TR_RemoteData _data)
91 95 retval = TR_new(TR_RemoteData, data, size, _data->remote);
92 96 }
93 97 } else {
94   - memcpy(message->data, data, size);
95   - message->size_done = size;
  98 + memcpy(message->data + message->size_done, data, size);
  99 + message->size_done += size;
96 100 }
97 101
98 102 TR_delete(_data);
... ...
... ... @@ -32,7 +32,7 @@ main (int argc, char * argv[])
32 32
33 33 client = TR_new(TR_SimpleClient, connection);
34 34
35   - for (i=0; i<100000; i++) {
  35 + for (i=0; i<10000000; i++) {
36 36 message = (TR_ProtoMessageRaw)TR_protoCreateRequest(
37 37 protocol, (TR_Socket)socket);
38 38 message->size = sizeof("test");
... ... @@ -42,13 +42,20 @@ main (int argc, char * argv[])
42 42 message = (TR_ProtoMessageRaw)TR_simpleClientIssue(
43 43 client,
44 44 (TR_ProtoMessage)message,
45   - 10000000);
  45 + 100);
46 46
  47 + if (! message) break;
47 48 #if 0
48 49 printf("%s\n", message->data);
49 50 #else
50 51 if (0 == strncmp("test", message->data, sizeof("test")-1)) {
51   - if (i % 1000 == 0) printf("%c", '.');
  52 + if (i % 1000 == 0) {
  53 + if (i % 10000 == 0) {
  54 + printf("%c", '#');
  55 + } else {
  56 + printf("%c", '.');
  57 + }
  58 + }
52 59 } else {
53 60 printf("%c", 'f');
54 61 }
... ...
Please register or login to post a comment