提交 91b61269 编写于 作者: S slguan

fix compile errors

...@@ -134,7 +134,7 @@ int tsem_init(tsem_t *sem, int pshared, unsigned int value) { ...@@ -134,7 +134,7 @@ int tsem_init(tsem_t *sem, int pshared, unsigned int value) {
errno = ENOMEM; errno = ENOMEM;
return -1; return -1;
} }
kern_return_t ret = semaphore_create(sem_port, &p->sem, SYNC_POLICY_FIFO, 0); kern_return_t ret = semaphore_create(sem_port, &p->sem, SYNC_POLICY_FIFO, value);
if (ret != KERN_SUCCESS) { if (ret != KERN_SUCCESS) {
fprintf(stderr, "==%s[%d]%s():[%p]==semophore_create failed\n", basename(__FILE__), __LINE__, __func__, sem); fprintf(stderr, "==%s[%d]%s():[%p]==semophore_create failed\n", basename(__FILE__), __LINE__, __func__, sem);
// we fail-fast here, because we have less-doc about semaphore_create for the moment // we fail-fast here, because we have less-doc about semaphore_create for the moment
......
...@@ -535,7 +535,7 @@ char *httpDecodeUrl(const char *enc) { ...@@ -535,7 +535,7 @@ char *httpDecodeUrl(const char *enc) {
dec = str.str; dec = str.str;
str.str = NULL; str.str = NULL;
} }
httpCleanupString(&str); //httpCleanupString(&str);
return dec; return dec;
} }
...@@ -646,7 +646,7 @@ static int32_t httpParserOnTarget(HttpParser *parser, HTTP_PARSER_STATE state, c ...@@ -646,7 +646,7 @@ static int32_t httpParserOnTarget(HttpParser *parser, HTTP_PARSER_STATE state, c
} }
break; break;
} }
parser->target = strdup(parser->str.str); parser->target = httpDecodeUrl(parser->str.str);
if (!parser->target) { if (!parser->target) {
httpError("context:%p, fd:%d, parser state:%d, char:[%c]%02x, oom", pContext, pContext->fd, state, c, c); httpError("context:%p, fd:%d, parser state:%d, char:[%c]%02x, oom", pContext, pContext->fd, state, c, c);
ok = -1; ok = -1;
...@@ -715,6 +715,10 @@ static int32_t httpParserOnVersion(HttpParser *parser, HTTP_PARSER_STATE state, ...@@ -715,6 +715,10 @@ static int32_t httpParserOnVersion(HttpParser *parser, HTTP_PARSER_STATE state,
if (parser->method) { if (parser->method) {
ok = httpOnRequestLine(parser, parser->method, parser->target, parser->version); ok = httpOnRequestLine(parser, parser->method, parser->target, parser->version);
if (parser->target) {
free(parser->target);
parser->target = NULL;
}
} }
httpClearString(&parser->str); httpClearString(&parser->str);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册