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

The Future of the Feathery/FTP library in MegaGlest #199

Open
Jammyjamjamman opened this issue Jun 26, 2020 · 9 comments
Open

The Future of the Feathery/FTP library in MegaGlest #199

Jammyjamjamman opened this issue Jun 26, 2020 · 9 comments

Comments

@Jammyjamjamman
Copy link
Contributor

@Jammyjamjamman Jammyjamjamman commented Jun 26, 2020

As @tomreyn stated about feathery in #197 :

Yet another option would be to replace the feathery lib and all calls to it (won't be few) code by just libcurl (HTTP/FTP client, MG already uses it), and a small HTTP server for the host part. I don't think MG ever uploads via FTP, just downloads, so that's probably a sufficient, and probably much better, alternative.
I assume it would be a backwards incompatible change, though. And would likely involve an amount of work. FTP really deserves to R.I.P., though.

Our options for feathery are therefore:

  • Leave it as it is.
  • Get rid of feathery ftp and either replace it with curl (which is already a dependency to MegaGlest) or get rid of ftp entirely in the code.
@andy5995
Copy link
Contributor

@andy5995 andy5995 commented Jun 27, 2020

* Get rid of feathery ftp and either replace it with curl (which is already a dependency to MegaGlest) or get rid of ftp entirely in the code.

Right now, feathery is used as an ftp server to serve maps, mods, etc, and curl is used to download. Is that right?

I was just reading through the libcurl docs a little, and see that it can be used to transfer data to and from a server, but I don't get the impression it can be used as a "server", even though it can send. So basically, if the client were using curl to retrieve a file from an MG host, the MG host could not send it with curl.

Some comments about it and a few options for http server libs at

https://stackoverflow.com/a/32559308/6838037

@tomreyn
Copy link
Member

@tomreyn tomreyn commented Jun 28, 2020

Right now, feathery is used as an ftp server to serve maps, mods, etc, and curl is used to download. Is that right?

I am convinced this is correct.

I was just reading through the libcurl docs a little, and see that it can be used to transfer data to and from a server, but I don't get the impression it can be used as a "server", even though it can send. So basically, if the client were using curl to retrieve a file from an MG host, the MG host could not send it with curl.

I agree. I'm convinced that libcurl does not implement any HTTP or FTP servers nor does it provide functionality for this purpose. You can use the HTTP (and likely also FTP) client code it provides to have a client send data (HTTP POST, FTP upload) to a server, but this is not relevant here, a MegaGlest instance hosting a game needs to host file downloads for connected game clients.

Some comments about it and a few options for http server libs at

https://stackoverflow.com/a/32559308/6838037

More small footprint HTTP servers could probably be found in Debian, or using a web search engine looking for, e.g.
( "http server" OR "httpd" ) AND ( small OR tiny OR minimal OR micro )
Replacing the FTP server code by HTTP server code would not entirely overcome the need for port forwarding, but would make things less terrible. HTTP downloads need exactly one port forwarded (or two at most if you do HTTP+HTTPS).

This said, there are certainly more pressing issues in MegaGlest, if it is to live much longer, such as a need for IPv6 support.

@tomreyn
Copy link
Member

@tomreyn tomreyn commented Aug 11, 2020

Related: MegaGlest is going to be removed off Debian because it fails to build from source (FTBFS):

megaglest 3.13.0-5 is marked for autoremoval from testing on 2020-09-01

It is affected by these RC bugs:
966892: megaglest: FTBFS: ld: ../shared_lib/liblibmegaglest.a(ftpAccount.c.o):./obj-x86_64-linux-gnu/source/shared_lib/./source/shared_lib/include/feathery_ftp/ftpTypes.h:84: multiple definition of `ftpIsClientAllowedToGetFile'; /usr/bin/ld: DWARF error: could not find variable specification at offset f7c1
https://bugs.debian.org/966892

@softcoder
Copy link
Member

@softcoder softcoder commented Aug 11, 2020

@tomreyn
Copy link
Member

@tomreyn tomreyn commented Aug 11, 2020

Fixed how? But certainly any fix you can provide would be great to have!

@softcoder
Copy link
Member

@softcoder softcoder commented Aug 11, 2020

@andy5995
Copy link
Contributor

@andy5995 andy5995 commented Aug 11, 2020

@softcoder , @Jammyjamjamman committed the feathery_ftp fix in 5a35205 and I've got a PR that adds a test for building with g++-10 (rebased after the feathery patch).

@softcoder
Copy link
Member

@softcoder softcoder commented Aug 11, 2020

@andy5995
Copy link
Contributor

@andy5995 andy5995 commented Aug 11, 2020

In order to build on Debian testing/bullseye? I think that's it. As for Debian Sid, there's issue #196. Though #198 could be a problem soon as well.

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

No branches or pull requests

4 participants