Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/SimulPiscator/AirSane
Browse files Browse the repository at this point in the history
  • Loading branch information
Simul Piscator committed Jan 10, 2021
2 parents 1041c1d + 677fbb9 commit b246307
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.macOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ There, execute the following commands:
```
sudo port install sane-backends jpeg libpng
sudo port install cmake
git clone github.com/SimulPiscator/AirSane.git
git clone https://github.com/SimulPiscator/AirSane.git
mkdir AirSane-build && cd AirSane-build
cmake ../AirSane
make
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Build files and instructions for OpenWRT have been published here:
### Build on macOS
AirSane may be run on a macOS installation in order to serve locally attached
scanners to eSCL clients such as Apple Image Capture. For instructions, see
[the macOS README file](README-macOS.md).
[the macOS README file](README.macOS.md).

### Build and install from source on Debian/Ubuntu/Raspbian
#### Build
Expand Down
2 changes: 1 addition & 1 deletion server/mainserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ bool MainServer::run()
pService.reset();
}

std::shared_ptr<ScannerServer> pServer = std::make_shared<ScannerServer>(pScanner, mPublisher.hostname(), port);
std::shared_ptr<ScannerServer> pServer = std::make_shared<ScannerServer>(pScanner, mPublisher.hostname(), interfaceIndex(), port);
mScanners.push_back(ScannerEntry({pScanner, pService, pServer}));
}
::clock_gettime(CLOCK_MONOTONIC, &t);
Expand Down
3 changes: 2 additions & 1 deletion server/scannerserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <fstream>
#include <csignal>

ScannerServer::ScannerServer(std::shared_ptr<Scanner> pScanner, const std::string& host, uint16_t port)
ScannerServer::ScannerServer(std::shared_ptr<Scanner> pScanner, const std::string& host, int idx, uint16_t port)
: mpScanner(pScanner), mpThread(nullptr), mHost(host)
{
HttpServer::setInterfaceIndex(idx);
HttpServer::setPort(port);
mpThread = new std::thread([this]{this->run();});
}
Expand Down
2 changes: 1 addition & 1 deletion server/scannerserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class ScannerServer: public HttpServer
{
public:
ScannerServer(std::shared_ptr<Scanner>, const std::string& host, uint16_t port);
ScannerServer(std::shared_ptr<Scanner>, const std::string& host, int interfaceIndex, uint16_t port);
~ScannerServer();

protected:
Expand Down
2 changes: 1 addition & 1 deletion web/httpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ HttpServer &HttpServer::setInterfaceIndex(int i)
else {
unsigned int idx = i;
char buf[IF_NAMESIZE] = { 0 };
if(!::if_indextoname(idx, buf)) {
if(::if_indextoname(idx, buf)) {
p->mInterfaceName = buf;
p->mInterfaceIndex = i;
}
Expand Down

0 comments on commit b246307

Please sign in to comment.