Skip to content

Draft version - #3

Open
Pr0meTheuSS wants to merge 3 commits into
mainfrom
http-proxy
Open

Draft version#3
Pr0meTheuSS wants to merge 3 commits into
mainfrom
http-proxy

Conversation

@Pr0meTheuSS

Copy link
Copy Markdown
Owner

a draft version of the proxy. In the following episodes:

  • graceful shutdown
  • checking under load

QUESTION:
should this proxy work with https too?

@k-stolyarov

Copy link
Copy Markdown
Collaborator

a draft version of the proxy. In the following episodes:

* graceful shutdown

* checking under load

QUESTION: should this proxy work with https too?

finish your work with graceful shutdown.

Only HTTP 1.0 required.

Comment thread level1/httproxy/http_server.c Outdated
char buffer[BUFFER_SIZE];
ssize_t bytes_received, bytes_sent;

bytes_received = recv(client_socket, buffer, sizeof(buffer), 0);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please handle requests that longer than BUFFER_SIZE-1

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread level1/httproxy/http_server.c Outdated
*client_socket_ptr = client_socket;

// Create a new thread to handle the request
if (pthread_create(&tid, NULL, handle_request, (void *)client_socket_ptr) != 0) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check what is the maximum amount of concurrently handled connections and explain what limiting factor you faced.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
This is due to the fact that the system has a limit on the number of open file descriptors, and open sockets use this resource

@k-stolyarov k-stolyarov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accepted

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