Fixed annoying debugging message and UTF8 issue
This commit is contained in:
parent
6131005658
commit
dbd8e73ab5
@ -29,7 +29,7 @@ NAN_METHOD(audio::available_devices) {
|
||||
auto device_info = Nan::New<v8::Object>();
|
||||
auto device = devices[index];
|
||||
|
||||
Nan::Set(device_info, Nan::LocalString("name"), Nan::LocalString(device->name));
|
||||
Nan::Set(device_info, Nan::LocalString("name"), Nan::LocalStringUTF8(device->name));
|
||||
Nan::Set(device_info, Nan::New<v8::String>("driver").ToLocalChecked(), Nan::New<v8::String>(device->driver).ToLocalChecked());
|
||||
Nan::Set(device_info, Nan::New<v8::String>("device_id").ToLocalChecked(), Nan::New<v8::String>(base64::encode(digest::sha1(device->name + device->driver))).ToLocalChecked());
|
||||
|
||||
|
@ -147,7 +147,7 @@ void UDPSocket::callback_read(evutil_socket_t fd) {
|
||||
source_address_length = sizeof(sockaddr);
|
||||
read_length = recvfrom(fd, (char*) buffer, (int) buffer_length, MSG_DONTWAIT, &source_address, &source_address_length);
|
||||
if(read_length <= 0) {
|
||||
if(errno == EAGAIN)
|
||||
if(errno == EAGAIN || read_length == 0)
|
||||
break;
|
||||
|
||||
logger::warn(category::socket, tr("Failed to receive data: {}/{}"), errno, strerror(errno));
|
||||
|
Loading…
Reference in New Issue
Block a user