Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cpoIT
Copy link

@cpoIT cpoIT commented Mar 15, 2019

@Tulf

  • Kat

src/client.c Outdated
path = forward_slash + 1;
*forward_slash = '\0';

colon = strchr(hostname, '/');
Copy link

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;
Copy link

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,
Copy link

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);
Copy link

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);
Copy link

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

@Tulf
Copy link

Tulf commented Mar 16, 2019

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.

@cpoIT
Copy link
Author

cpoIT commented Mar 16, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants