Hello, Applied the two patches, thanks!
Note that in this caes it makes sense to keep them in the same patch, for two reasons: - it's essentially the same kind of change, so better batch them together. - currently, the code assumes that the server response is the same for the HEAD and the GET requests. So we really have to request them in the same way to try to get this to hopefully be true (but again, I don't think we want to keep the HEAD request). Samuel Gianluca Cannata, le mer. 14 janv. 2026 11:43:10 +0100, a ecrit: > Hi Samuel, Amos, Hurd team, > > below you can find a first patch towards HTTP compatibility that fixes > the HEAD request so that we can successfully do the following: > > settrans -fac /tmp/site/ ./httpfs -D www.example.com/ > In the HTML parser for parsing tmp > trying to open www.example.com:80/http://www.example.com/ > entering the main loop > > ls -1 /tmp/site/ > filling out dir tmp > index.html > > Hope it helps. > > Sincerely, > > Gianluca > Index: httpfs/http.c > =================================================================== > --- httpfs.orig/http.c > +++ httpfs/http.c > @@ -110,7 +110,7 @@ error_t open_connection(struct netnode * > } > > /* Send a HEAD request find header length */ > - sprintf(buffer,"HEAD %s HTTP/1.0\n\n",node->conn_req); > + sprintf(buffer,"HEAD %s HTTP/1.0\r\nHost: > %s\r\n\r\n",node->conn_req,node->url); > towrite = strlen (buffer); > written = TEMP_FAILURE_RETRY (write (*fd, buffer, towrite)); > if ( written == -1 || written < towrite ) Gianluca Cannata, le mer. 14 janv. 2026 12:14:24 +0100, a ecrit: > Hi Samuel, > > I have forgotten to attach the patch. Sorry. > > Gianluca > > Il giorno mer 14 gen 2026 alle ore 12:13 Gianluca Cannata > <[email protected]> ha scritto: > > > > Hi Samuel, > > > > here the second patch in the series that fixes the HTTP GET request > > when the httpfs translator tries to fill the node with the file > > content. > > > > Sincerely, > > > > Gianluca > Index: httpfs/http.c > =================================================================== > --- httpfs.orig/http.c > +++ httpfs/http.c > @@ -278,7 +278,7 @@ error_t fill_dirnode (struct netnode *di > strcat(conn_req,"/"); > } > comm_buf=(char > *)malloc((strlen(conn_req)+20)*sizeof(char)); > - sprintf(comm_buf,"GET %s HTTP/1.0",conn_req); > + sprintf(comm_buf,"GET %s HTTP/1.0\r\nHost: > %s\r\n\r\n",conn_req,url); > > nd = httpfs_make_node > (go->f_type,url,conn_req,comm_buf,f_name); > if (!nd) -- Samuel <D> N: j'aime bien Cut d'un truc enorme... ca montre de quel cote de l'ecran sont les gonades :))) -+- #ens-mim et la peufeupeu -+-
