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

'mosquitto_pub -l' doesn't see end-of-file #676

Closed
deviance opened this Issue Jan 22, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@deviance

deviance commented Jan 22, 2018

When mosquitto_pub is run in stdin-line mode (with -l switch), then it does not recognize EOF in case of zero-length input.
I am using v1.4.14

$ LD_LIBRARY_PATH=$(pwd)/lib client/mosquitto_pub --help | head -n 2
mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit.
mosquitto_pub version 1.4.14 running on libmosquitto 1.4.14.

The command that hangs up is:

$ LC_ALL=en_US dd if=/dev/zero count=0 | LD_LIBRARY_PATH=$(pwd)/lib client/mosquitto_pub -h iot.eclipse.org -t test/topic -d -l
0+0 records in
0+0 records out
0 bytes copied, 4.8251e-05 s, 0.0 kB/s
Client mosqpub|11199-home-pc sending CONNECT
Client mosqpub|11199-home-pc received CONNACK

I expect the mosquitto_pub -l to behave in this regard the same as mosquitto_pub -s:

$ LC_ALL=en_US dd if=/dev/zero count=0 | LD_LIBRARY_PATH=$(pwd)/lib client/mosquitto_pub -h iot.eclipse.org -t test/topic -d -s
0+0 records in
0+0 records out
0 bytes copied, 5.2439e-05 s, 0.0 kB/s
Error: Zero length input.
Error loading input from stdin.


ralight added a commit that referenced this issue Jan 22, 2018

@ralight ralight added this to the fixes-next milestone Jan 22, 2018

@ralight

This comment has been minimized.

Contributor

ralight commented Jan 22, 2018

Thanks very much, lovely and easy to reproduce. Could you check the fixes branch and close the bug if it works for you?

@deviance

This comment has been minimized.

deviance commented Jan 22, 2018

This works for me, thanks.

@deviance deviance closed this Jan 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment