Hot answers tagged

2

indexes As you predicted, these failures :( Requesting /test/ outputs /test/index.html :( Requesting directory containing index.php outputs index.php \ expected output, not an exit code of 0 come from indexes(). This \ expected output, not an exit code of 0 is usually a segfault check and check2 have no memory allocated. lookup Your use of '...


1

What's the thing that makes a string a string? Why, the terminating null-byte, of course! Rewatch a couple of minutes of Week 2, 2nd lecture starting around 9:00. That's where Rob talks about the null terminator ('\0'). abs_path and query both gotta end with one of those. NULL is a defined constant, not a char. added In other words, when you are done with ...


1

[answer removed to respect the Honor Code]


1

Your function now has index.php written two times. One here: strcat(php, "index.php"); Another here: strcat(html, "index.php");


1

I think the problem is here: if (x == 1) { char *pth_t = strtok(rqt, "?"); //char pth[strlen(pth_t) + 1]; strcpy(abs_path, pth_t); char *qry_t = strtok(NULL, "?"); //char qry[strlen(qry_t) + 1]; strcpy(query, qry_t); Try to test if qry_t is not NULL before strcpy() it to query. Do this because if rqt was just /hello.php?, the ...


1

I'm having a similar problem - not sure what is going on with your code, but the only thing I can see is that if there's a question mark, and only a question mark, you're not making the query "" aka the null terminator. That's precisely the case with hello.php? I'm a bit confused on how you're getting cat2.html and cat3.html to pass though as I didn't ...


1

First, I love cacahuetes. Second: I can tell you one problem right away. This part won't work with pipe streams like php files: if (fseek(file, 0 , SEEK_END) != 0) { DBG_Print("\n%i\n", __LINE__); return false; } *length = ftell(file); To get the load() function working correctly 100% of the time, one usually needs to read from the ...


1

load() seems to be the only function that you should edit that gets called in transfer(). Instead of debugging transfer() I would make sure load() works. If you are debugging transfer() because you think you might have edited something from the original code, you can always download the code from the beginning in a new folder. You can create a new folder ...


Only top voted, non community-wiki answers of a minimum length are eligible