0
@@ -111,19 +111,15 @@ void http_version_cb(void *data, const char *at, size_t length)
0
env_add_const(client, EBB_HTTP_VERSION, at, length);
0
-int atoi_len(const char *str, int len)
0
- int i, mult, retr = 0;
0
- for(mult=1, i=len-1; i>=0; i--, mult*=10)
0
- retr += (str[i] - '0') * mult;
0
void content_length_cb(void *data, const char *at, size_t length)
0
ebb_client *client = (ebb_client*)(data);
0
env_add_const(client, EBB_CONTENT_LENGTH, at, length);
0
- client->content_length = atoi_len(at, length);
0
+ /* atoi_length - why isn't this in the statndard library? i hate c */
0
+ for(mult=1, i=length-1; i>=0; i--, mult*=10)
0
+ client->content_length += (at[i] - '0') * mult;
Comments
No one has commented yet.