8-9/10... inconsistent book tests persist
This commit is contained in:
@@ -128,14 +128,14 @@ void* workerFunc(void *args){
|
||||
case RIP:
|
||||
// fprintf(stderr, "Handling RIP\n");
|
||||
// send errors are redundant to handle because exit
|
||||
zmq_send(responder, "rip", TYPE_LENGTH + 1, 0);
|
||||
zmq_send(responder, "rip\0", TYPE_LENGTH + 1, 0);
|
||||
zmq_close(responder);
|
||||
zmq_ctx_destroy(context);
|
||||
return NULL;
|
||||
break;
|
||||
case UNSUPPORTED:
|
||||
// perror("Got unsupported request\n");
|
||||
// rip();
|
||||
zmq_send(responder, "rip\0", TYPE_LENGTH + 1, 0);
|
||||
zmq_close(responder);
|
||||
zmq_ctx_destroy(context);
|
||||
return NULL;
|
||||
@@ -198,6 +198,8 @@ char* get_word(const char *request){
|
||||
|
||||
char* map(const char *content, key_value_pair **head, key_value_pair **tail){
|
||||
if(!content) return NULL;
|
||||
char *sanitized_content = sanitize_input((char*)content);
|
||||
content = sanitized_content;
|
||||
char *content_iterator = (char*)content;
|
||||
char *content_start_address = (char*)content;
|
||||
size_t content_length = strlen(content);
|
||||
@@ -217,9 +219,11 @@ char* map(const char *content, key_value_pair **head, key_value_pair **tail){
|
||||
|
||||
if(!ret){
|
||||
// perror("Could not extract key value pairs");
|
||||
free(sanitized_content);
|
||||
return strdup("");
|
||||
}
|
||||
free_key_value_pairs(head, tail);
|
||||
free(sanitized_content);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user