Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Kevin-P-Kerr/lilhttp
base: f3454cc75a
...
head fork: Kevin-P-Kerr/lilhttp
compare: 07609342b0
  • 5 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
5 http_server/src/header.h
@@ -5,6 +5,9 @@
#define OTHER 130
#define HTML 131
#define JS 132
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <netinet/in.h>
#include "dbg.h"
// declare structs
struct table {
@@ -36,7 +39,7 @@ int createSocket(int *);
int Bind(int *, struct sockaddr_in *);
-int Accept(int *, int *, struct sockaddr_in *, int *);
+int Accept(int *, int *, struct sockaddr_in *, socklen_t *);
int Read(int *, char *, int);
View
2  http_server/src/lexer.c
@@ -11,7 +11,7 @@ int getDiff(struct lexer *lex) {
fprintf(stderr, "LEX ERROR, LEXER.END IS ON EOF OR 0\n");
exit(EXIT_FAILURE);
} else {
- for (*lex->end; *lex->end!=' ' && *lex->end!='\n' && *lex->end!=EOF && *lex->end!='\0'; ++lex->end) {
+ for (; *lex->end!=' ' && *lex->end!='\n' && *lex->end!=EOF && *lex->end!='\0'; ++lex->end) {
fprintf(stderr, "%d\n", i);
i++;
}
View
3  http_server/src/main.c
@@ -22,7 +22,8 @@ int main(int argc, char *argv[]) {
} c("ALL TESTS PASSED"); */
//fprintf(stderr, "Tests run: %d\n", tests_run);
char *progname=argv[0];
- int sockfd, newsockfd, portno, clilen, n, pid, epollfd;
+ int sockfd, newsockfd, epollfd;
+ socklen_t clilen;
struct sockaddr_in serv_addr, cli_addr;
initFt();
clilen = 0;
View
3  http_server/src/request_handler.c
@@ -4,6 +4,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <unistd.h>
#include "header.h"
//request parsing and response building
@@ -45,7 +46,7 @@ int parseGet(char *request, char *response, int *i) {
c("in parseGet");
Token *tok;
struct lexer lex;
- int nc=0, rfd;
+ int rfd;
char *path;
char tmp[2*BUFSIZ];
View
2  http_server/src/sockets.c
@@ -32,7 +32,7 @@ int Bind(int *fd, struct sockaddr_in *skaddr) {
}
};
-int Accept(int *nsfd, int *sfd, struct sockaddr_in *cli_addr, int *clilen) {
+int Accept(int *nsfd, int *sfd, struct sockaddr_in *cli_addr, socklen_t *clilen) {
c("in Accept");
if ((*nsfd = accept(*sfd, (struct sockaddr *) cli_addr, clilen))<0) {
fprintf(stderr, "ACCEPT ERROR\n");

No commit comments for this range

Something went wrong with that request. Please try again.