-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sprint Web Server: Kat Johnson-Fries #144
base: master
Are you sure you want to change the base?
Conversation
src/client.c
Outdated
path = forward_slash + 1; | ||
*forward_slash = '\0'; | ||
|
||
colon = strchr(hostname, '/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a colon
src/client.c
Outdated
urlinfo->hostname = hostname; | ||
urlinfo->port = port; | ||
urlinfo->path = path; | ||
return urlinfo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're doing this again on line 91
src/client.c
Outdated
return 0; | ||
// ``` | ||
|
||
int request_length = snprintf(request, max_request_size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you're request is connecting properly
src/client.c
Outdated
} | ||
|
||
free(urlinfo->hostname); | ||
free(urlinfo->port); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to free these since you didn't malloc them.
free(urlinfo->hostname); | ||
free(urlinfo->port); | ||
free(urlinfo->path); | ||
free(urlinfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You only need this line
I tried fixing parts of your code and running it but even looking at my old repo and the solution I kept getting a segfault. Not sure why but you had many silly errors because of the amounts of comments you left in this code. It seems like you were really close though. |
I fixed the colon thing but didn’t push after that. I think it comes from trying things one way and then another and then another and not getting it to pass. I need to stop copying and pasting similar lines since I end up not completely changing the next. I could not figure out how to printf to see the responses.
…Sent from my iPhone
On Mar 15, 2019, at 9:15 PM, Tulf ***@***.***> wrote:
I tried fixing parts of your code and running it but even looking at my old repo and the solution I kept getting a segfault. Not sure why but you had many silly errors because of the amounts of comments you left in this code. It seems like you were really close though.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@Tulf